home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2006 May
/
PCWMAY06.iso
/
Software
/
Freeware
/
First Page 2006 3.00
/
fp2006-final-3.00-setup.exe
/
{app}
/
Iscripts
/
Forms Misc
/
checbox-counter.izs
< prev
next >
Wrap
Text File
|
2005-09-28
|
3KB
|
119 lines
<!NOWIZARD>
<!TITLE>Checkbox Counter
<!/TITLE>
<!DESCRIPTION>This script tells you in a msgbox how many of the checkboxes have been checked!<!/DESCRIPTION>
<!CATEGORY>Forms<!/CATEGORY>
<!SCRIPT>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL CHECKBOX COUNTER:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Alan Gruskoff (alan@performantsystems.com) -->
<!-- Web Site: http://www.performantsystems.com/ -->
<!-- Begin
function anyCheck(form) {
var total = 0;
var max = form.ckbox.length;
for (var idx = 0; idx < max; idx++) {
if (eval("document.playlist.ckbox[" + idx + "].checked") == true) {
total += 1;
}
}
alert("You selected " + total + " boxes.");
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<form method="post" name=playlist>
1<input type=checkbox name=ckbox>
<br>2<input type=checkbox name=ckbox>
<br>3<input type=checkbox name=ckbox>
<br>4<input type=checkbox name=ckbox>
<br>5<input type=checkbox name=ckbox>
<br>6<input type=checkbox name=ckbox>
<br>7<input type=checkbox name=ckbox>
<br>8<input type=checkbox name=ckbox>
<br>9<input type=checkbox name=ckbox>
<p><input type=button value="Count Checkboxes" onClick="anyCheck(this.form)">
</form>
<!-- END OF SCRIPT -->
<!/SCRIPT>
<!PREVIEW>
<!-- START OF SCRIPT -->
<!-- HOW TO INSTALL CHECKBOX COUNTER:
1. Copy code into the HEAD section of document
2. Put last coding into the BODY section of document -->
<!-- STEP ONE: Add code into HEAD section of document -->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Alan Gruskoff (alan@performantsystems.com) -->
<!-- Web Site: http://www.performantsystems.com/ -->
<!-- Begin
function anyCheck(form) {
var total = 0;
var max = form.ckbox.length;
for (var idx = 0; idx < max; idx++) {
if (eval("document.playlist.ckbox[" + idx + "].checked") == true) {
total += 1;
}
}
alert("You selected " + total + " boxes.");
}
// End -->
</script>
</HEAD>
<!-- STEP TWO: Add code into BODY section of document -->
<BODY>
<form method="post" name=playlist>
1<input type=checkbox name=ckbox>
<br>2<input type=checkbox name=ckbox>
<br>3<input type=checkbox name=ckbox>
<br>4<input type=checkbox name=ckbox>
<br>5<input type=checkbox name=ckbox>
<br>6<input type=checkbox name=ckbox>
<br>7<input type=checkbox name=ckbox>
<br>8<input type=checkbox name=ckbox>
<br>9<input type=checkbox name=ckbox>
<p><input type=button value="Count Checkboxes" onClick="anyCheck(this.form)">
</form>
<!-- END OF SCRIPT -->
<!/PREVIEW>
<!RELATED>NONE<!/RELATED>